This invention relates to the field of compressed digital video
As compressed video bitstreams increasingly find their way into the programme chain, techniques for their manipulation are required. One of the most important techniques is the ability to switch between two compressed signals. This is typically required for editing of programmes; this involves switching between different xe2x80x9cshotsxe2x80x9d, each of which will be a section from a bitstream. This may be done in real-time or non-real-time. Switching is also required in continuity/presentation, involving real-time switching between different studios-or other sources, and for local/regional xe2x80x9copt-outxe2x80x9d, that is to say switching from a network signal to regional or local programmes or commercials.
Switching of analogue video signals, or of non-compressed digital signals, is relatively straightforward to carry out, as suitable times for switching (called xe2x80x9cswitching pointsxe2x80x9d here) occur at regular intervals, typically during picture blanking. This is not the case with compressed signals, in which pictures often occupy a variable amount of time and/or bits. Furthermore the compression system may employ temporal prediction, which further complicates switching.
A simple way to switch bitstreams is to decode them, switch in the uncompressed domain, and re-code. This gives good flexibility, but the cascading of coding operations causes loss of picture quality. This can be a serious problem for some types of compression system, where there are many parameters and coding decisions that could be taken differently on re-coding. MPEG-2, currently the most important compression system for broadcasting, is such a system. This invention is intended primarily for MPEG-2 but can be used for other compression systems
One prior approach to switching without loss of quality is what is known as xe2x80x9ctransport stream splicingxe2x80x9d. This involves defining points (called xe2x80x9csplicing pointsxe2x80x9d) in the input bitstreams (in MPEG transport stream form) at which they can be switched directly. Two variations have been proposed: xe2x80x9cseamless splicingxe2x80x9d and xe2x80x9cnon-seamless splicingxe2x80x9d.
Splicing is potentially inexpensive to implement, as there is no need to decode or re-code the video. However it lacks flexibility for several reasons.
The switch can only occur at certain times, determined by the MPEG Group of Pictures (GOP) structure. The frame before the switch must be an I- or P-frame and the frame after it must be an I-frame. This typically means that the switch can only be specified to about half a second of resolution.
The video switching point determines when any corresponding audio is switched, because the video and audio are part of a single transport stream. It is not possible to have independent video and audio switching points.
The upstream coders must know when switching may be required; if they do not, they might have to insert a large number of splicing points.
A coder producing a bitstream with seamless splicing points may have to compromise its coding performance to insert these points. This is because the buffer trajectory of a downstream coder must be exactly fixed at the splicing points, making the rate control requirements of the coder more difficult, especially if there are a large number of splicing points. A proposal has been made to get round this problem by inserting synthetic fade-in sequences around the switching points, but this restricts the usefulness of splicing.
Transitions other than simple cuts (ie cross-fades) are not possible.
Another approach is to switch and re-code the decoded inputs but not make use of the full set of coding options available, for example, within the MPEG-2 xe2x80x9ctoolsetxe2x80x9d. By reducing the number of decisions and parameters that can change on re-coding, the amount of additional distortion introduced is reduced. One prior proposal makes use of this idea, by employing a relatively simple GOP structure of IBIBIBIB (c.f. IBBPBBPBBPBBIBBP . . . which is typically used). The drawbacks of this approach are that restricting the coding options tends to require a higher bitrate for the same picture quality, and that it introduces incompatibilities with other coding equipment using the full range of options.
An earlier BBC patent application, WO 97/08898 described a bitstream switch using a decode-switch-re-code approach, but in this case, the decoder produced an additional output, giving the coding decisions used by the original coder. By using the same decisions on recoding, the additional degradation introduced would be small. This switch also included bypass paths, used many frames away from the switching point, which ensure that the switch can be made completely transparent, but the use of these complicates the operation of the switch.
It is an object of the present invention to provide improved methods and apparatus for the switching of compressed video bitstreams.
Accordingly, the present invention consists in one aspect in apparatus for the switching of compressed video bitstreams comprising a first decoder for receiving a first input bitstream and providing a first decoded video signal and a first coding decision signal; a second decoder for receiving a second input bitstream and providing a second decoded video signal and a second coding decision signal; a video switch for switching between said first and second video signals; a coder for re-coding said switched video signal and coding decision processing means for receiving said first and second coding decision signals and delivering coding decisions to said coder, such that in the steady state said decoding and re-coding is substantially transparent.
It has been shown that for re-coding using the same coding decisions, the additional distortion introduced is negligible under normal circumstances. Thus the decoder and re-coder can be kept xe2x80x9cin-circuitxe2x80x9d at all times, simplifying the switch.
The coding decision information may include: picture dimensions; frame rate; picture structure (frame-coded or field-coded); picture type (I,P or B); whether macroblocks are intra-coded or use prediction; whether forward, backward or bi-directional prediction is used; motion vectors; quantiser visibility weighting matrices; quantiser step and buffer state of a downstream decoder.
Advantageously, said coding decision processing means serves around the switching point to modify coding decisions for re-coding. In particular, the refresh strategy may be modified on recoding, by moving the recoding I-frames as P-frames, and/or vice versa, or by use of a xe2x80x9cI-P pairxe2x80x9d of MPEG field structure pictures. The purpose of this is to prevent the downstream decoder""s buffer from becoming too full or empty, due to I-frames coming too far apart or too close together in the switched bitstream.
Advantageously, underflow of a downstream decoder buffer is avoided through reduction of bitrate for frames adjacent the switching point. A psycho-visual effect known as xe2x80x9ctemporal maskingxe2x80x9d can be employed to prevent the downstream decoder""s buffer from becoming too empty. Quantisation noise in the frames very close to the switching point is often not visible to the observer and so the number of bits used in these frames can be deliberately reduced.
Preferably, said coding decision processing means receives buffer occupancy information such that the bit usage in the input bitstreams is taken into account in the re-coder""s rate control algorithm.